/*  1:   */ package com.atomikos.datasource.xa.session;
/*  2:   */ 
/*  3:   */ import com.atomikos.datasource.xa.XAResourceTransaction;
/*  4:   */ import com.atomikos.datasource.xa.XATransactionalResource;
/*  5:   */ import com.atomikos.icatch.CompositeTransaction;
/*  6:   */ import com.atomikos.icatch.HeuristicMessage;
/*  7:   */ import com.atomikos.icatch.system.Configuration;
/*  8:   */ 
/*  9:   */ class BranchEndedStateHandler
/* 10:   */   extends TransactionContextStateHandler
/* 11:   */ {
/* 12:   */   private CompositeTransaction ct;
/* 13:   */   
/* 14:   */   BranchEndedStateHandler(XATransactionalResource resource, XAResourceTransaction branch, CompositeTransaction ct)
/* 15:   */   {
/* 16:49 */     super(resource, null);
/* 17:50 */     this.ct = ct;
/* 18:51 */     branch.suspend();
/* 19:   */   }
/* 20:   */   
/* 21:   */   TransactionContextStateHandler checkEnlistBeforeUse(CompositeTransaction ct, HeuristicMessage hmsg)
/* 22:   */     throws InvalidSessionHandleStateException
/* 23:   */   {
/* 24:57 */     String msg = "Detected illegal attempt to use a closed XA session";
/* 25:58 */     Configuration.logWarning(msg);
/* 26:59 */     throw new InvalidSessionHandleStateException(msg);
/* 27:   */   }
/* 28:   */   
/* 29:   */   TransactionContextStateHandler sessionClosed()
/* 30:   */   {
/* 31:65 */     return null;
/* 32:   */   }
/* 33:   */   
/* 34:   */   TransactionContextStateHandler transactionTerminated(CompositeTransaction tx)
/* 35:   */   {
/* 36:71 */     TransactionContextStateHandler ret = null;
/* 37:72 */     if (this.ct.isSameTransaction(tx)) {
/* 38:72 */       ret = new TerminatedStateHandler();
/* 39:   */     }
/* 40:73 */     return ret;
/* 41:   */   }
/* 42:   */   
/* 43:   */   boolean isInactiveInTransaction(CompositeTransaction tx)
/* 44:   */   {
/* 45:78 */     return this.ct.isSameTransaction(tx);
/* 46:   */   }
/* 47:   */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.datasource.xa.session.BranchEndedStateHandler
 * JD-Core Version:    0.7.0.1
 */